package com.osce.basic.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csce.domain.entity.basic.BasicSchoolYear;
import com.osce.basic.mapper.BasicSchoolYearMapper;
import com.osce.common.utils.DateUtils;
import com.osce.interfaces.basic.IBasicSchoolYearService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学年表Service业务层处理
 *
 * @author zzx
 * @since 2023-07-18
 */
@Service
public class BasicSchoolYearServiceImpl extends ServiceImpl<BasicSchoolYearMapper, BasicSchoolYear> implements IBasicSchoolYearService {


    /**
     * 查询学年表
     *
     * @param id 学年表主键
     * @return 学年表
     */
    @Override
    public BasicSchoolYear selectBasicSchoolYearById(Long id) {
        return baseMapper.selectBasicSchoolYearById(id);
    }

    /**
     * 查询学年表列表
     *
     * @param basicSchoolYear 学年表
     * @return 学年表
     */
    @Override
    public List<BasicSchoolYear> selectBasicSchoolYearList(BasicSchoolYear basicSchoolYear) {
        return baseMapper.selectBasicSchoolYearList(basicSchoolYear);
    }

    /**
     * 新增学年表
     *
     * @param basicSchoolYear 学年表
     * @return 结果
     */
    @Override
    public int insertBasicSchoolYear(BasicSchoolYear basicSchoolYear) {
        basicSchoolYear.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertBasicSchoolYear(basicSchoolYear);
    }

    /**
     * 修改学年表
     *
     * @param basicSchoolYear 学年表
     * @return 结果
     */
    @Override
    public int updateBasicSchoolYear(BasicSchoolYear basicSchoolYear) {
        return baseMapper.updateBasicSchoolYear(basicSchoolYear);
    }

    /**
     * 批量删除学年表
     *
     * @param ids 需要删除的学年表主键
     * @return 结果
     */
    @Override
    public int deleteBasicSchoolYearByIds(Long[] ids) {
        return baseMapper.deleteBasicSchoolYearByIds(ids);
    }

    /**
     * 删除学年表信息
     *
     * @param id 学年表主键
     * @return 结果
     */
    @Override
    public int deleteBasicSchoolYearById(Long id) {
        return baseMapper.deleteBasicSchoolYearById(id);
    }
}
